package com.sdx.console.crm.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.crm.dao.CrmQuestionTypeDao;
import com.sdx.console.crm.entity.CrmQuestionType;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 客服问题类型 Service
 */

@Service
@Transactional
public class CrmQuestionTypeService extends BaseService<CrmQuestionType>{

    @Resource
	private CrmQuestionTypeDao crmQuestionTypeDao;

    public PageQuery<CrmQuestionType>queryByCondition(PageQuery query){
        PageQuery ret =  crmQuestionTypeDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelCrmQuestionType(List<String> ids){
        try {
            crmQuestionTypeDao.batchDelCrmQuestionTypeByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除客服问题类型失败", e);
        }
    }

	public List<CrmQuestionType> all() {
		return crmQuestionTypeDao.all();
		}
}